{% extends "base.html" %}

{% block title%} Search Page {%endblock%}

{% block content%}
<h1>Search Page</h1>
<form method="post" action="">
    {{form}}
    <input type="submit" value="Search"/>
</form>

{% if pages %}
    <h2> Search results for page names</h2>
    <ol>
    {% for page in pages%}
    <li>{{page.name|safe}}</li>
    {%endfor%}
    </ol>
{%endif%}

{% if contents %}
    <h2> Search results for page content</h2>
    <ol>
    {% for page in contents%}
    <li>{{page.name|safe}}</li>
    {%endfor%}
    </ol>
{%endif%}

{% if nothing %}
    <h2> No items were found.</h2>
{%endif%}

{%endblock%}